<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css"/>
    <!--时间选择器样式-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/jedate.css" />
    <!--引入分页-->
    <link rel="stylesheet" href="../../../lib/pagination/pagination.css">
    <!--表单验证-->
    <script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css"/>
    <title>新增渠道</title>
</head>
<body data-id="">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页  <span class="c-gray en">&gt;</span>对接平台管理 <span class="c-gray en">&gt;</span> 渠道管理 <span class="c-gray en">&gt;</span> 密钥设置<a
        class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
        href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="coupon-add">
        <div>
            <div class="bg-1 bk-gray pd-20 mb-20">
                <table class="table-hover mb-10 mt-10 table">
                    <thead class="text-l">
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>App_Key：</label>
                                <div class="formControls f-l">
                                    <div style="float: left">
                                    <input type="text" style="width:300px" nullmsg="录入必填信息！" errormsg="格式错误" class="input-text radius" name="customerId" id="customerId"
                                           readonly>
                                    </div>
                                    <div style="float: left">
                                        <a  onclick="copy1()">复制</a>
                                    </div>
                                </div>
                            </div>
                        </td>

                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>App_Serect：</label>

                                <div class="formControls f-l">
                                    <input type="text" style="width:300px"  nullmsg="录入必填信息！" errormsg="录入必填信息"  class="input-text radius" name="customerCode" id="customerCode"
                                           readonly>
                                </div>
                                <div style="float: left">
                                    <a  onclick="copy2()">复制</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                    </thead>
                </table>
                <div class="text-c mb-10 ">
                    <input id="bottm" type="submit" class="btn btn-secondary radius size-S"
                           value="生成">
                    <!--<a class="btn btn-secondary radius size-S ml-10" onclick="pircaladd()">保存</a>-->
                    <button class="btn radius size-S" onclick="colse()">关闭</button>

                </div>
            </div>
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<!--引入分页-->
<link rel="stylesheet" href="../../../lib/pagination/pagination.css">
<script src="../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/Customer/Customer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../ht-js/frame/doT.min.js?rev=@@hash"></script>
<script src="../../../ht-js/dockingplatform/channel/passwordSetting.js?rev=@@hash"></script>
<script>
    function colse() {
        parent.layer.closeAll();
    }
    function copy1()
    {
        var Url2=document.getElementById("customerId");
        Url2.select();
        document.execCommand("Copy");
    }
    function copy2()
    {
        var Url2=document.getElementById("customerCode");
        Url2.select();
        document.execCommand("Copy");
        //alert("复制成功");
    }
    $(function () {

        $.ajax({
            url:root.dockingplatform.getAppKeyAndAppSecret,
            cache: false,
            type: "POST",
            dataType:'json',
            contentType: "application/json",
            data: JSON.stringify({
                "parentCustomerCode": sessionStorage.getItem("customerCode"),
            }),
            success: function (data) {
                if(data.errorCode==0){
                    //showmsg("保存成功",6);
                    if (data.data.appKey!=''){
                        console.log(data.data.account);
                        $("#customerId").val(data.data.account);
                        $("#customerCode").val(data.data.password);
                        // $("#bottm").hide();
                    }
                }else {
                    $.Huimodalalert(data.msg,2000);
                }
                //$("#bottm").attr("style","display:none;");

            },
            error: function () {
                $.Huimodalalert('保存失败！',2000);
            }
        })


        $("#coupon-add").Validform({
            tiptype: 1,
            callback: function (form) {
                passwordSave();
                return false;
            }
        });
    })
</script>
</body>
</html>